package org.jeecg.modules.inspection.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.inspection.entity.*;
import org.springframework.stereotype.Repository;

import java.util.List;


/**
 * @Description: 巡更点
 * @Author: jeecg-boot
 * @Date:   2019-09-20
 * @Version: V1.0
 */
@Repository
public interface InspectionAreaMapper extends BaseMapper<InspectionArea> {
   @Select("select * from set_inspection_area_item where area_id =#{areaId} and del_flag =0")
   List<InspectionAreaItem> selectAreaItemByProject(@Param("areaId")String areaId);
   @Select("select * from set_inspection_item where office_id =#{officeId}\n" +
           "OR  company_id = #{companyId}\n" +
           "OR tenant_id='1'\n" +
           " AND del_flag ='0'")
   List<InspectionItem> findAllConfigItem(@Param("officeId")String officeId,@Param("companyId")String companyId);
   List<FloorInfo> findAllFloor(@Param("projectId")String projetcId);
   @Select("select * from set_inspection_area where office_id = #{officeId} and del_flag ='0'")
   List<InspectionArea> getAreaByOffice(@Param("officeId")String officeId);
   List<InspectionArea> selectArea(@Param("areaIds")List<String> areaIds);
   List<PinspetionArea> selectAreaByLine(@Param("processId")String processId);
   @Select("select floor_sum from base_floor_info where id = #{floorId}")
   Integer findFloorNumList(@Param("floorId") String floorId);
   @Select("select item_id from set_inspection_area_item where area_id= #{areaId}")
   List<String> findAllAreaItemConfig(@Param("areaId")String areaId,@Param("officeId")String officeId,@Param("companyId")String companyId);

}
